home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cpuspe.zip / CPU.H next >
C/C++ Source or Header  |  1992-10-30  |  1KB  |  60 lines

  1.  
  2. #if defined(__TURBOC__)                     /* Turbo C */
  3.     #if __STDC__
  4.         #define _Cdecl
  5.     #else
  6.         #define _Cdecl  cdecl
  7.     #endif
  8.     #define _Near
  9. #endif
  10.  
  11.  
  12.  
  13.  
  14. int    _Cdecl cpu(void);
  15. void    initializetimer(void);
  16. long    readtimer(void);
  17. void    restoretimer(void);
  18. void    elapsedtime(long start,long stop,double *result);
  19. char    *cpuspeed(unsigned char round,unsigned char cputype);
  20.  
  21.  
  22.  
  23. /*
  24. ==============================================================================
  25.     Determines the CPU type.
  26.     Example :-
  27.  
  28.     int ctype;
  29.     ctype=cpu();
  30.  
  31.  
  32. Type Table:
  33.     0    =    Undetermined
  34.     1    =    8086/8088
  35.     2    =    8086/8088 with Coprocessor
  36.     3    =    80286
  37.     4    =    80286 with Coprocessor
  38.     5    =    i386tm
  39.     6    =    i386tm with 387 Coprocessor
  40.     7    =    i386tm with 87/287 Coprocessor
  41.     8    =    i486tm (SX)
  42.     9    =    i486tm (DX) or i487tm (SX) with Coprocessor
  43.  
  44.  
  45.  
  46. ==============================================================================
  47. ==============================================================================
  48.     Get CPU speed.
  49.     Example :-
  50.  
  51. void main(void)
  52.     {
  53.     clrscr();
  54.     cprintf("CPU speed is %s MHz\n\r",cpuspeed(1,CPU()));
  55.     }
  56.  
  57.     arg1    =    (int) 0 or 1, 1 = round result to whole value;
  58.     arg2    =    (int) return result from CPU();
  59. */
  60.